function startCourse()
{
	
	if( typeof sessionStorage === "undefined" || sessionStorage.disabled )
	{
		alert( "You must enable cookies for this course to work properly." );
	}
	else
	{
		
        if( !sessionStorage.getItem( "course_started" ) )
        {
        	
            sessionStorage.clear();
            
            
    		sessionStorage.setItem( "course_started", "1" );
    		sessionStorage.setItem( "sun", "0" );
    		sessionStorage.setItem( "alpha", "0" );
			sessionStorage.setItem( "barnards", "0" );
			sessionStorage.setItem( "wolf", "0" );
			sessionStorage.setItem( "quiz", "0" );

        }
	}
}

function visitSun()
{
	sessionStorage.setItem( "sun", "visited" );
	showQuiz();
}

function visitAlpha()
{
	sessionStorage.setItem( "alpha", "visited" );
	showQuiz();
}

function visitBarnards()
{
	sessionStorage.setItem( "barnards", "visited" );
	showQuiz();
}

function visitWolf()
{
	sessionStorage.setItem("wolf","visited");
	showQuiz();
	}

function showTest()
{
	sessionStorage.setItem("quiz","visited");
	showQuiz();
	}




function showQuiz()
{
	var sunvisited = sessionStorage.getItem( "sun" );
	var alphavisited = sessionStorage.getItem( "alpha" );
	var barnardsvisited = sessionStorage.getItem( "barnards" );
	var wolfvisited = sessionStorage.getItem( "wolf" );
	
	if( sunvisited == "visited" && alphavisited == "visited"
		&& barnardsvisited == "visited" && wolfvisited == "visited" )
	{
		document.getElementById( "link-test" ).style.display = "inline";
	}
}

function finishOLM()
{
	oScorm.save();
	oScorm.quit();
}


